package com.cet.designpatterns.bridge;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-09-08 23:15
 **/
public class Client {
    public static void main(String[] args) {
        Phone phone1 = new FoldedPhone(new Vivo());
        invoke(phone1);
        Phone phone2 = new FoldedPhone(new XiaoMi());
        invoke(phone2);
        Phone phone3 = new UpRightPhone(new Vivo());
        invoke(phone3);
        Phone phone4 = new UpRightPhone(new XiaoMi());
        invoke(phone4);
    }

    public static void invoke(Phone phone) {
        System.out.println("======================");
        phone.open();
        phone.call();
        phone.close();
    }
}
